import {Entity, Column} from 'typeorm';
import {BaseEntity} from "@/entitys/common/baseEntity";

// 团类型
export enum TourGroupTypeEnum {
    "overall" = "0", // 整团
    "scatter" = "1", // 散拼团
}

// 团状态
export enum TourGroupStateEnum {
    "unconfirmed" = "0", // 未确认
    "confirm" = "1", // 确认
    "cancel" = "2", // 取消
    "opReview" = "3", // 计调审核
    "financeReview" = "4", // 财务审核
    "archive" = "5", // 归档
}

@Entity({comment: "旅游团表"})
export class TourGroup extends BaseEntity {
    @Column({comment: '团号'})
    tourGroupNumber: string;

    @Column({
            type: "enum",
            comment: '团类型',
            enum: TourGroupTypeEnum,
            default: TourGroupTypeEnum.overall,
        }
    )
    tourGroupType: TourGroupTypeEnum;

    @Column({comment: '线路名称'})
    itineraryName: string;

    @Column({comment: '发团时间', type: 'date', nullable: true})
    startDate: Date;

    @Column({comment: '散团时间', type: 'date', nullable: true})
    endDate: Date;

    @Column({comment: '计调'})
    opId: number;

    @Column({comment: '收客订单id', type: "json"})
    receiverList: number[];

    @Column({
        type: "enum",
        comment: '状态',
        enum: TourGroupStateEnum,
        default: TourGroupStateEnum.unconfirmed
    })
    state: TourGroupStateEnum;

}